

/*                      */
/* your code goes here */
/*                      */

//setup loading screen - loading extensions

booky().load( {
    overlay: true,  multiInstances:true, onload: init,
    libs: ["booky.styles.css",      //window styles
           "booky.windows.js",      //wrap a window around the current selection
           "booky.form.js",         //validate and serialize form data
           "booky.ajax.js"]         //submit the serialized form data
});       

//loading screen and list of things to load (alkso loads extensions here)
function init() { 
    //setup a form, and then make the form a window       
     var win = booky(  "<label>Title</label>    <input    name=title    class=notEmpty id=title />"+
                       "<label>Url</label>      <input    name=url      class=url />"+
                       "<label>Code</label>     <textarea name=code     class=notEmpty></textarea>"+     
                       
                       "<input value=Submit type=button class=submit />"
                    )
                    
                    //setup the window title etc and put it on the page
                  .window({   title:      "Submit Code Snippet",
                                width:      "220px",   
                                height:     "300px",    
                                left:       "34px", 
                                cssClass:   "testwindow"
                            })
                    
                    //enable validation - cssClass on form element ditermines validation type
                    .clientValidate();
            
    //setup the submit button to serialize the form data and send it to the server        
    win.sel(".submit")[0].onclick = function() {   
    
        var data = booky(win).formSerialize(true);
    
        booky.ajax.load('test.php?'+data, function(data) {
            booky.confirm("ok", {title:"Booky Test", message:"Returned data: " + data}); }, 'text', 'get');
        };
            
    };
    
    
    
    
    
    
/*
    
    //automatically fill out the form
    booky().sel("#title")[0].value =    document.title;
    win.sel(".url")[0].value =          window.location.href;
    win.sel("textarea")[0].value =      booky("code")[0].innerHTML; //nice if i couild do booky('code').eq(0).innerHTML and somehow the innerHTML would act like a function...
    
    
    */
    
    
    
    
    //add validation
    //win.clientValidate();            
    
    
    
    
    
    
    
    
    
    
                        
    //animate it down
    //win.effects.slide(win, -20, 0, 20, 20, 0.9); //want it to act more like jquery perhaps
    //borrow jquery effects....
    


